package com.hangxin.basic.mapping;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.RowMapper;

import com.hangxin.basic.model.LoginInfo;
public class LoginInfoRowMapper implements RowMapper<LoginInfo>{
	Logger logger = LoggerFactory.getLogger(this.getClass());



	@Override
	public LoginInfo mapRow(ResultSet rs, int arg1)
	{
		LoginInfo loginInfo = new LoginInfo();
		try
		{
			loginInfo.setId(rs.getLong("id"));
			loginInfo.setUserName(rs.getString("username"));
			loginInfo.setPass(rs.getString("pass"));
			loginInfo.setCompanyid(rs.getLong("companyid"));
			loginInfo.setState(rs.getString("state"));
			loginInfo.setAddTime(rs.getString("addTime"));
			loginInfo.setApplicant(rs.getLong("applicant"));
			loginInfo.setRealName(rs.getString("realName"));
		} catch (SQLException e)
		{
			logger.error("用户登录信息映射出错");
			throw new RuntimeException(e);
		}
		return loginInfo;
	}

}
